package com.example.mall.domain;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.mall.util.CodeGenerateUtils;

import java.io.Serializable;

/**
 * <p>
 * 商品规格表
 * </p>
 *
 * @author whale
 * @since 2025-05-06
 */
@TableName("tb_product_specs")
public class ProductSpecs extends Model<ProductSpecs> {

    private static final long serialVersionUID = 1L;

    /**
     * 规格唯一标识
     */
    @TableId("spec_id")
    private Long specId;
    /**
     * 商品id
     */
    @TableField("product_id")
    private Long productId;
    /**
     * 规格名称（如颜色、尺寸）
     */
    @TableField("spec_name")
    private String specName;
    /**
     * 规格值（如红色、M号）
     */
    @TableField("spec_value")
    private String specValue;
    /**
     * 创建时间
     */
    @TableField("create_date")
    private Date createDate;
    /**
     * 更新时间
     */
    @TableField("update_date")
    private Date updateDate;

    public ProductSpecs() {
        this.specId = Long.valueOf(CodeGenerateUtils.generateUniqueId());
    }

    public Long getSpecId() {
        return specId;
    }

    public void setSpecId(Long specId) {
        this.specId = specId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getSpecName() {
        return specName;
    }

    public void setSpecName(String specName) {
        this.specName = specName;
    }

    public String getSpecValue() {
        return specValue;
    }

    public void setSpecValue(String specValue) {
        this.specValue = specValue;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    @Override
    public String toString() {
        return "ProductSpecs{" +
        ", specId=" + specId +
        ", productId=" + productId +
        ", specName=" + specName +
        ", specValue=" + specValue +
        ", createDate=" + createDate +
        ", updateDate=" + updateDate +
        "}";
    }
}
